package org.one.stone.soup.grfxML;

import java.util.Vector;

public class RenderPipe extends Vector {

    public boolean hasChanged = true;
    
    public void addElement(Object element)
    {
        super.addElement(element);
        
        hasChanged=true;
    }
    
    public boolean removeElement(Object element)
    {
        boolean result = super.removeElement(element);
        hasChanged=true;
        
        return result;
    }
    
    public boolean hasChanged()
    {
        if(hasChanged==true)
        {
            return true;
        }
        
        for(int loop=0;loop<size();loop++)
        {
            Geometry geo = (Geometry)elementAt(loop);
            if(geo.hasChanged())
            {
                //System.out.println("Geo changed:"+geo);
                return true;
            }
        }
        
        return false;
    }
    
    public void resetChanged()
    {
        hasChanged=false;
        
        for(int loop=0;loop<size();loop++)
        {
            Geometry geo = (Geometry)elementAt(loop);
            geo.resetChanged();
        }
    }
}
